var version = localStorage.getItem("version")
if (!version || version == null || version == "undefined") {
    var nowdate = new Date();
    version = nowdate.getFullYear().toString() + "." + (nowdate.getMonth() + 1) + "." + nowdate.getDate();
}

function loadjs(url, isappendversion) {
    if (isappendversion) {
        url += "?version=" + version;
    }
    document.write('<script src= ' + url + '></script>');
}

function GetRootPath() {
    var loc = window.location,
        host = loc.hostname,
        protocol = loc.protocol,
        port = loc.port ? (':' + loc.port) : '';
    var path = location.pathname;

    if (path.indexOf('/') === 0) {
        path = path.substring(1);
    }

    var mypath = '/' + path.split('/')[0];
    path = (mypath != undefined ? mypath : ('/' + loc.pathname.split('/')[1])) + '/';

    var rootPath = protocol + '//' + host + port + path;
    return rootPath;
}

loadjs(GetRootPath() + "js/hpStaticFileLoad.js", true);